package com.mrjy.coursepackage.controller;

import com.mrjy.common.entity.CoursePackageCommentInfo;
import com.mrjy.coursepackage.bo.ICoursePackageCommentInfoBo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * 课程包基本信息 控制器
 *
 * @author csshui
 */
@Controller
@RequestMapping("/coursepackage/coursePackageCommentInfo")
public class CoursePackageCommentInfoController {


    @Resource
    private ICoursePackageCommentInfoBo CoursePackageCommentInfoBo;

    /**
     * 新增课程包数据
     *
     * @return
     */
    @RequestMapping("/insert")
    @ResponseBody
    public Object insert(CoursePackageCommentInfo info) {
        return CoursePackageCommentInfoBo.txInsert(info);
    }

    /**
     * 根据id更新
     *
     * @param info
     * @return
     */
    @RequestMapping("/updateById")
    @ResponseBody
    public Object updateById(CoursePackageCommentInfo info) {
        return CoursePackageCommentInfoBo.txUpdateById(info);
    }

    /**
     * 通过id查询
     *
     * @param id
     * @return
     */
    @RequestMapping("/selectById")
    @ResponseBody
    public Object selectById(Integer id) {
        return CoursePackageCommentInfoBo.selectById(id);
    }

    /**
     * 通过id删除
     *
     * @param id
     * @return
     */
    @RequestMapping("/delete")
    @ResponseBody
    public Object delete(Integer id) {
        return CoursePackageCommentInfoBo.txDelete(id);
    }

    /**
     * 新增课程包数据
     *
     * @return
     */
    @RequestMapping("/insertSelective")
    @ResponseBody
    public Object insertSelective(CoursePackageCommentInfo info) {
        return CoursePackageCommentInfoBo.insertSelective(info);
    }


    /**
     * 根据id更新
     *
     * @param info
     * @return
     */
    @RequestMapping("/updateDisableFlag")
    @ResponseBody
    public Object updateDisableFlag(CoursePackageCommentInfo info) {
        return CoursePackageCommentInfoBo.updateDisableFlag(info);
    }

    /**
     * 通过Cid查询用户课程包评价详情
     *
     * @param info
     * @return
     */
    @RequestMapping("/selectUserDetailByCId")
    @ResponseBody
    public Object selectUserDetailByCId(CoursePackageCommentInfo info, HttpSession session) {
        return CoursePackageCommentInfoBo.selectUserDetailByCId(info, session);
    }

    /**
     * 通过Cid查询用户课程包评价List
     *
     * @param info
     * @return
     */
    @RequestMapping("/selectPageByCid")
    @ResponseBody
    public Object selectPageByCid(CoursePackageCommentInfo info) {
        return CoursePackageCommentInfoBo.selectPageByCid(info);
    }

    /**
     * 查询用户课程包评价List
     *
     * @param info
     * @return
     */
    @RequestMapping("/selectPageList")
    @ResponseBody
    public Object selectPageList(CoursePackageCommentInfo info) {
        return CoursePackageCommentInfoBo.selectPageList(info);
    }


    /**
     * 导出 用户课程包评价List
     *
     * @param info
     * @return
     */
    @RequestMapping("/export")
    @ResponseBody
    public Object export(CoursePackageCommentInfo info, HttpServletResponse response, HttpSession session) {
        return CoursePackageCommentInfoBo.export(info, response, session);
    }

}
